VB Mapi Demo Program wwwwwwwwwwwww Form1% Compose_BTN &Compose Delete_BTN &Delete Read_BTN &Read New_BTN SubjectList IdList Heading_LBL Messages: Options_MENU Options Logon_MENU Logon Logoff_MENU Logoff Status_MENU Status Window PopupErrors_MENU Popup Errors Command1_Clickk retcode MAPILogon Form1 MAPISessoin MapiSession Logon_Clickx Text] SessionWin Logoff_Click MAPILogoff SessionWin_Change Send_Click5 MAPIMessage MapiRecip MapiFile MAPISendMessage Subject@ NoteText RecipCount FileCount; MAPISendMail Nameg RecipType/ MAPI_TOK RecipClass$ MAPI_CC FileName| config' FileType PathName Position Save_Click MAPISaveMail FindNext_Click MAPIFindNext ReadMail_Click MAPIReadMail MsgId Form_Click Recips Files SessionX UIParam MessageID Flags Reservedq Message Orig? nFiles nRecipsS BMAPIReadMail SUCCESS_SUCCESS BMAPIGetReadMail elseEnd IfEnd MAPIAddressX Caption Label nRecipients Recipients nNewRecips NewRecips NewRecipients RecipientCount, BMAPIAddress5 nEditFields@ Labels BMAPIGetAddressN Body_Change ID_Changek Label1_Click{ Label2_Click Label3_Click DateReceived ConversationIDk MessageType MAPI_NO_MESSAGES. begin Retcode_Change) msgid1$ ErrorMsg errtext errtext_ChangeH ErrMsg MailList Fomr1 List_Click List. ListHdr @ Form_Load From1 Logoff Enable FALSE Logon| Enabledt Delete_ClickU MAPIDelete MAPIDeleteMail ListIndex/ Address_Click reciph asLong@ Class Address ListHdr_Click7 Resolve_BTN_Click MapiResolveName hSession Recipient Rcpnt MapiRecipient Details_BTN_ClickO MAPIDetails ListCount= Logon_BTN_Click Logon_BTN SUCCESS* count MAPI_LOGON_UI MAPI_USER_ABORTk MAPI_E_FAILURE MAPI_E_TOO_MANY_SESSIONSY MAPI_E_LOGON_FAILURE Form2q Logoff_BTN[ MAPI_E_USER_ABORT Status ErrCode_EDIT ErrString_EDIT ErrCode Operation_EDITQ Session_EDIT ignore ToolForm1e Tools LoggedInAs_TXT DisplayStatus MAPI_E_LOGIN_FAILUREm @ Form_Unload Cancel List_DblClick& selected StoreInList index EndLoopI IdList MapiRecipReDimm SubjectList Delete_BTN_Click New_BTN_Click Read_BTN_Click Save_BTN_Click xxxxxx SubjectList_Click SubjectList_DblClick Unhide Compose4 MAPI_E_TOO_MANY_SESSION Options_MENU_Click Logoff_MENU_Click Logon_MENU_Click Compose_BTN_Click display results OldCursor MousePointer Status_MENU_Click Status_MENU Checked MsgId_EDIT PopupError_MENU PopupErrors PopupErrors_MENU PopupErrors_MENU_Click Compose_BTN_Click Load and display the compose window when the user clicks on the compose buttonu Delete_BTN_Click If there's no mail listed, then just exit this subroutine Get the list index of the selectede item, then retrive it's id from an associated msgid list. Call MAPIDeleteMail with the msgid of the mail to be deleted. Delete Mail if the call was successful, then we deletee the msgid from IdList and the subject from the SubjectList.L Form_Load Display the hourglass cursor until* the ReadMail call completes Log the user on.r Display information in the status windowi Logon Tools.Logoff_BTN.Enabled = TRUE* Tools.Logon_BTN.Enabled = FALSE* Find all the user's mail and display it in the SubjectList. The correspondingn message id's are stored in the IdList.L Read the mail and display the subject in the SubjectListe Highlight the first item in the list Set status display in status window Display the tools and status windowsn Tools.Show Restore original mouse pointeri Form_Unload Mapi Demo is shutting down, unloadn any displayed windows and Logoffo Logoff_MENU_Click Call MAPILogoff, display resultss and set the MapiSession global var. Logoff Logon_MENU_Click Call MAPILogonL Logging On Clear out the msg id listbox* Retrive the user's mail and display the subject line from each message. The messages mail id is store in the IdList, and the Subject is stored in the SubjectListt Highlight the first item in the subject list New_BTN_Click Display the hourglass cursor until* the ReadMail call completes Clear out the msg id listbox* Retrieve messages until we get an error or no more message to get Display the subject in the SubjectListe and add the message id to the IDListt Find new mail Highlight the first item in the subject list PopupErrors_MENU_Click Read_BTN_Click Ignore the read request if there'se no mail available to read Load the View window to display the mail messages Status_MENU_Click SubjectList_Click Set the MsgId Global Var* SubjectList_DblClick Set the MsgId Global var and load the View window to display the mail message